package datamining.miner.chain;

import java.util.Collection;

import datamining.miner.general.Embedding;
import de.parsemis.miner.general.HPEmbedding;

/**
 * This class implements the general child generation based on stored
 * embeddings.
 */
public class EmbeddingBasedGenerationStep<ItemType> extends
		GenerationStep<ItemType> {
	/**
	 * creates a new GenerationStep
	 * 
	 * @param next
	 *                the next step of the mining chain
	 */
	public EmbeddingBasedGenerationStep(final MiningStep<ItemType> next) {
		super(next);
	}

	@Override
	public void call(final SearchLatticeNode<ItemType> node,
			final Collection<Extension<ItemType>> extensions) {
		super.reset();
		extensions.clear();
		for (final Embedding<ItemType> e : node.allEmbeddings()) {
			super.call(node, e);
		}
		super.call(node, extensions);
	}

}
